<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/base/base.jsp"%>
<%@ include file="/base/database.jsp" %>
	
	<%

		request.setCharacterEncoding("utf-8");
		
		String stuID=request.getParameter("stuID");
		String classID=request.getParameter("classID");
		String stuName=request.getParameter("stuName");
		String sex=request.getParameter("sex");
		String address=request.getParameter("address");
		String stuTel=request.getParameter("stuTel");
		String contact=request.getParameter("contact");
		String contactTel=request.getParameter("contactTel");
		
		StringBuffer sqlBuff=new StringBuffer();
		sqlBuff.append("update sys_student set stuID=?,classID=?,stuName=?,sex=?,address=?,stuTel=?,contact=?,contactTel=? where stuID=?");
		String sql=sqlBuff.toString();
		
		Connection conn=getConn();
		PreparedStatement pstmt=conn.prepareStatement(sql);
		
		int parameterIndex=1;
		
		pstmt.setString(parameterIndex++, stuID);
		pstmt.setNString(parameterIndex++,classID);
		pstmt.setNString(parameterIndex++,stuName);
		pstmt.setNString(parameterIndex++,sex);
		pstmt.setNString(parameterIndex++,address);
		pstmt.setString(parameterIndex++,stuTel);
		pstmt.setString(parameterIndex++, contact);
		pstmt.setString(parameterIndex++,contactTel);
		pstmt.setString(parameterIndex++, stuID);
		
		int c=pstmt.executeUpdate();
		
		if(pstmt!=null){
			pstmt.close();
		}
		if(conn!=null){
			conn.close();
		}
		
		process(request,response,"student_list.jsp");
		
		
		%>